package com.tan.controller;


import com.tan.pojo.Department;
import com.tan.response.Result;
import com.tan.service.impl.DepartmentServiceImpl;
import com.tan.utils.RedisUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author tanRuYi
 * @since 2021-08-25
 */
@RestController
@RequestMapping("/department")
@CrossOrigin
@Api(tags = "部门模块")
public class DepartmentController {

    @ApiModelProperty("部门服务类")
    @Autowired
    DepartmentServiceImpl departmentService;

    @GetMapping("/getAll")
    @ApiOperation("查询全部的部门信息")
    public Result getAllList() {

        final List<Department> department = departmentService.getBaseMapper().getDepartment();

        return Result.ok().data("data", department);
    }
}

